#!/bin/bash
set -e
dnf install -y git cmake

# 安装开发套件
dnf groupinstall -y "Development Tools"
dnf install -y gflags-devel zlib-devel lz4-devel \
               leveldb-devel glog-devel numactl-devel \
               gperftools-devel doca-all

sudo chmod -R +x protobuf-3.20.3
cd protobuf-3.20.3 && ./configure && make -j && sudo make install && sudo ldconfig
cd ..

cd BenchBF3/third_party
git clone https://gitee.com/minhanghuang/brpc.git
cd brpc
git checkout 1.5.0
mkdir build && cd build
cmake .. -DWITH_GLOG=ON
make -j
cd ..
cp -r build/output .
cd ../../

echo "所有依赖安装完成！"
